package mock.servicesdirectory.organisations.web.action;

import java.util.List;

import mock.servicesdirectory.common.entities.Directorate;
import mock.servicesdirectory.common.entities.SupportingMaterial;
import mock.servicesdirectory.organisations.business.businessinterface.DirectorateBO;
import mock.servicesdirectory.organisations.business.businessinterface.SupportingMaterialBO;

import com.opensymphony.xwork2.ActionSupport;

public class DirectorateAction extends ActionSupport{
	
	private DirectorateBO directorateBO;
	// Directorate Name
	private String directorateName;
	//Type of Bussiness
	private String typeOfBussiness;
	//shortDescription
	private String shortDescription;
	//sicCode
	private String sicCode;
	//lead Contact
	private String leadContact;
	//directorate Full Description
	private String directorateFullDescription;
	//copy From Address
	private String copyFromAddress;
	// phone Number
	private int phoneNumber;
	// addressLine1
	private String addressLine1;
	//fax
	private String fax;
	//address Line 2
	private String addressLine2;
	//email
	private String email;
	//address Line 3
	private String addressLine3;
	//web Address
	private String webAddress;
	//post Code
	private int postCode;
	//charity Number
	private int charityNumber;
	//town City
	private int townCity;
	//company Number
	private int companyNumber;
	//county
	private String county;
	//nation
	private String nation;
	
	
	private List<Directorate> gridModel;	
	private Integer rows = 0;	
	private Integer page = 0;	
	private String sord;	
	private String sidx;
	private String searchField;
	private String searchString;
	private String searchOper;	
	private Integer total = 0;
	private Integer records = 0;
	
	// Getter and Setter
			
	public DirectorateBO getDirectorateBO() {
		return directorateBO;
	}
	public void setDirectorateBO(DirectorateBO directorateBO) {
		this.directorateBO = directorateBO;
	}
	public String getDirectorateName() {
		return directorateName;
	}
	public void setDirectorateName(String directorateName) {
		this.directorateName = directorateName;
	}
	public String getTypeOfBussiness() {
		return typeOfBussiness;
	}
	public void setTypeOfBussiness(String typeOfBussiness) {
		this.typeOfBussiness = typeOfBussiness;
	}
	public String getShortDescription() {
		return shortDescription;
	}
	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}
	public String getSicCode() {
		return sicCode;
	}
	public void setSicCode(String sicCode) {
		this.sicCode = sicCode;
	}
	public String getLeadContact() {
		return leadContact;
	}
	public void setLeadContact(String leadContact) {
		this.leadContact = leadContact;
	}
	public String getDirectorateFullDescription() {
		return directorateFullDescription;
	}
	public void setDirectorateFullDescription(String directorateFullDescription) {
		this.directorateFullDescription = directorateFullDescription;
	}
	public String getCopyFromAddress() {
		return copyFromAddress;
	}
	public void setCopyFromAddress(String copyFromAddress) {
		this.copyFromAddress = copyFromAddress;
	}
	public int getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(int phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getAddressLine1() {
		return addressLine1;
	}
	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getAddressLine2() {
		return addressLine2;
	}
	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddressLine3() {
		return addressLine3;
	}
	public void setAddressLine3(String addressLine3) {
		this.addressLine3 = addressLine3;
	}
	public String getWebAddress() {
		return webAddress;
	}
	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}
	public int getPostCode() {
		return postCode;
	}
	public void setPostCode(int postCode) {
		this.postCode = postCode;
	}
	public int getCharityNumber() {
		return charityNumber;
	}
	public void setCharityNumber(int charityNumber) {
		this.charityNumber = charityNumber;
	}
	public int getTownCity() {
		return townCity;
	}
	public void setTownCity(int townCity) {
		this.townCity = townCity;
	}
	public int getCompanyNumber() {
		return companyNumber;
	}
	public void setCompanyNumber(int companyNumber) {
		this.companyNumber = companyNumber;
	}
	public String getCounty() {
		return county;
	}
	public void setCounty(String county) {
		this.county = county;
	}
	public String getNation() {
		return nation;
	}
	public void setNation(String nation) {
		this.nation = nation;
	}
	public String save(){
		return SUCCESS;
	}
	public String back(){
		return SUCCESS;
	}
	public String creat(){
		return SUCCESS;
	}
	public String detail(){
		return SUCCESS;
	}
	public String department(){
		return SUCCESS;
	}
	
	
	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public String getSearchOper() {
		return searchOper;
	}

	public void setSearchOper(String searchOper) {
		this.searchOper = searchOper;
	}

	public String getSearchString() {
		return searchString;
	}

	public void setSearchString(String searchString) {
		this.searchString = searchString;
	}

	public String getSearchField() {
		return searchField;
	}

	public void setSearchField(String searchField) {
		this.searchField = searchField;
	}

	public String getSidx() {
		return sidx;
	}

	public void setSidx(String sidx) {
		this.sidx = sidx;
	}

	public String getSord() {
		return sord;
	}

	public void setSord(String sord) {
		this.sord = sord;
	}

	public List<Directorate> getGridModel() {
		return gridModel;
	}

	public void setGridModel(List<Directorate> list) {
		this.gridModel = list;
	}

	public String execute() {		
		records = 30;
		rows = 10;
		
		setGridModel(directorateBO.getDirectorate(1));
		setTotal((int) Math.ceil((double) records / (double) rows));

		return SUCCESS;
	}

	// Method to filter all Directorate
	public String filterAll(){
		// Call methods to get all database of Directorate via DirectorateBOImpl.getDirectorate()
		return SUCCESS;
	}
	
	// Method to filter Directorate start with 0-9
	public String filter09(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(1)
		return SUCCESS;
	}
	
	// Method to filter Directorate start with ABCDE
	public String filterAE(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(2)
		
		return SUCCESS;
	}
	
	// Method to filter Directorate start with FGHIJ
	public String filterFJ(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(3)
		
		return SUCCESS;
	}
	
	// Method to filter Directorate start with KLMN
	public String filterKN(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(4)
		
		return SUCCESS;
	}
	
	// Method to filter Directorate start with OPQR
	public String filterOR(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(5)
		
		return SUCCESS;
		
	}
	
	// Method to filter Directorate start with STUV
	public String filterSV(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate(6)
		
		return SUCCESS;
	}
	
	// Method to filter Directorate start with STUV
	public String filterWZ(){
		// Call methos to get database of Directorate where name start with a digit 0-9 via DirectorateBOImpl.getDirectorate()
		
		return SUCCESS;
	}
	
	// Check directorate name is not null ?
	public boolean checkDirectorateName(String name) {
		// TODO Auto-generated method stub
		if(name.length() == 0){
			return false;
		}
		else{
			return true;
		}
	}

	// Check address line 1 is not nulll
	public boolean checkAddressLine1(String addressline1) {
		// TODO Auto-generated method stub
		if(addressline1.length() == 0){
			return false;
		}
		else{
			return true;
		}
	}
	
	// Check postcode is exist in database or not ?
	public boolean checkPostCode(int postcode) {
		// TODO Auto-generated method stub
		// Call ContactBOImpl.checkExistPostCode(int postcode)
		
		return false;
	}

}
